import os
import glob
import tqdm
import shutil

label_path = "/home/jiayu/Desktop/Jimmy/1219(分六组)/1001-1219_nerve_label"
src_path = "/home/jiayu/Desktop/Jimmy/1219(分六组)/1001-1219(enh8)"
save_path = "/home/jiayu/Desktop/Jimmy/1219(分六组)/600-1219_all_nerve/img"
if not os.path.exists(save_path):
    os.makedirs(save_path)

for file in tqdm.tqdm(glob.glob(os.path.join(label_path, "*"))):
    base_name = os.path.basename(file)[:-4]
    img_file = os.path.join(src_path, base_name + ".png")
    save_to_file = os.path.join(save_path, base_name + ".png")
    shutil.copyfile(src=img_file, dst=save_to_file)
